<template>
  <!-- element-plus中文化 -->
  <el-config-provider :locale="locale">
    <router-view></router-view>
  </el-config-provider>
</template>

<script >
import { defineComponent, provide, nextTick } from "vue";

import { ElConfigProvider } from "element-plus";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
export default defineComponent({
  components: {
    ElConfigProvider,
  },
  setup() {
    const isRouterActive = ref(true);
    provide("reload", () => {
      isRouterActive.value = false;
      nextTick(() => {
        isRouterActive.value = true;
      });
    });

    return {
      locale: zhCn,
      isRouterActive,
      provide,
    };
  },
});
</script>

<style scoped>
</style>
